package com.kool.evowkf.bean.io.approve;

import com.kool.core.base.BaseBean;
import com.kool.core.exception.AppException;
import com.kool.core.util.StringUtils;
import com.kool.core.validate.IIoValidate;

/**
 * @AUTHOR LUYU
 */
public class CMADDAPRWORKERXBean extends BaseBean implements IIoValidate {
	protected String seq;
	protected String userCid;
	protected String loginName;

	public String getSeq() {
		return seq;
	}

	public void setSeq(String seq) {
		this.seq = seq;
	}

	public String getUserCid() {
		return userCid;
	}

	public void setUserCid(String userCid) {
		this.userCid = userCid;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Override
	public void validate() throws AppException {
		// 非空校验
		if (StringUtils.isEmpty(seq)) {
			throw new AppException("SY000036","seq");//字段[%1]为空
		}
		// 非空校验
		if (StringUtils.isEmpty(userCid)) {
			throw new AppException("SY000036","userCid");//字段[%1]为空
		}
		// 最大长度校验
		if (userCid != null && userCid.length() > 10) {
			throw new AppException("SY000038","userCid",String.valueOf(10));//字段[%1]大于最大长度[%2]
		}
		// 非空校验
		if (StringUtils.isEmpty(loginName)) {
			throw new AppException("SY000036","loginName");//字段[%1]为空
		}
		// 最大长度校验
		if (loginName != null && loginName.length() > 60) {
			throw new AppException("SY000038","loginName",String.valueOf(60));//字段[%1]大于最大长度[%2]
		}
	}
}